package com.chensheng.util;

/**
 * @Author:ChenSheng
 * @Description:
 * @Date: Created in 下午 20:41 2018/5/17 0017
 */
public class MathUtil {

    private static final Double MONEY_RANGE = 0.01;

    /*
    * 比较两个Double类型的金额是否相等
    * */
    public static Boolean equals(Double d1, Double d2){
        Double result = Math.abs(d1 - d2);
        if(result < MONEY_RANGE){
            return true;
        }else{
            return false;
        }
    }

}
